create external table jms_dm.dm_end_dispatch_store_level_detail_dt 
(
  agent_code string COMMENT '代理区编码', 
  agent_name string COMMENT '代理区名称', 
  franchisee_code string COMMENT '加盟商code', 
  franchisee_name string COMMENT '加盟商name', 
  virt_code string COMMENT '虚拟代理区code', 
  virt_name string COMMENT '虚拟代理区name', 
  network_code string COMMENT '网点编码', 
  network_name string COMMENT '网点名称', 
  store_code string COMMENT '门店code', 
  store_name string COMMENT '门店name', 
  build_type string COMMENT '建设类型', 
  index_name string COMMENT '指标名称', 
  index_value decimal(20,10) COMMENT '指标值（率值、）', 
  index_score decimal(16,2) COMMENT '指标得分', 
  store_score decimal(16,2) COMMENT '驿站得分', 
  score_level string COMMENT '驿站等级', 
  date_time date COMMENT '日期', 
  business_id string COMMENT '品牌id', 
  business_name string COMMENT '品牌名稱' )
comment '末端驿站明细'
PARTITIONED BY ( dt string COMMENT '时间分区')
stored as parquet
LOCATION '/dw/hive/jms_dm.db/external/dm_end_dispatch_store_level_detail_dt'
TBLPROPERTIES (     'discover.partitions' = 'false',  'parquet.column.index.access' = 'true');

alter table jms_dm.dm_end_dispatch_store_level_detail_dt
add columns(
     store_in_total  int comment'门店入库量'
    , index_value_fz int comment'率值分子：拦截量、出库量、投诉量等'
    , source_type  string comment'类型：机柜、驿站'
) cascade
